package com.googlecode.sparda.commons.io.stream.policy;

import java.io.OutputStream;

import com.googlecode.sparda.commons.io.stream.ManagedOutputStream;

/**
 * This policy select the oldest opened stream for closure on {@link ManagedOutputStream}.
 * @author Fabio Grucci (<i>alias</i> <b>Phoenix</b>)
 *
 */
public class CloseOldestOpenedStreamCMOSPolicy extends AbstractCMOSPolicy{
	/*
	 * (non-Javadoc)
	 * @see com.googlecode.sparda.commons.io.stream.policy.ClosingManagedOutputStreamPolicy#getStreamToClose()
	 */
	@Override
	public ManagedOutputStream<? extends OutputStream> getStreamToClose() {
		return super.openedStream.getFirst();
	}

}
